DEFINE VARIABLE i AS INTEGER.
DEFINE VARIABLE k AS INTEGER.
DEFINE VARIABLE part AS CHARACTER.

i = 0.
k = 0.
part = "".
FOR EACH pc_mstr NO-LOCK:

    FIND FIRST pt_mstr WHERE pt_part = pc_part NO-LOCK NO-ERROR.
    IF NOT AVAILABLE (pt_mstr) THEN DO:
       i = i + 1.

       IF part <> pc_part THEN DO:
          k = k + 1.
          part = pc_part.
       END.
    END.

    IF pc_start > date('06/05/01') THEN
       DISP pc_part pc_list pc_start pc_expire.
END.

MESSAGE  'Total Records=' i 'Total Items=' k.
